package com.yanggu.scala.chapater07.extend

object ScalaFieldOverrideDemo01 {

  def main(args: Array[String]): Unit = {
    val bbb : AAA = new BBB
    val aaa = new AAA
    println(bbb.age)
    println(aaa.age)
  }

}

class AAA {

  val age : Int = 20

}

class BBB extends AAA{

  override val age : Int = 20

}